<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>课程管理</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f4f4f4;
            margin: 0;
            padding: 0;
        }

        h1 {
            text-align: center;
            background-color: #0084ff;
            color: #fff;
            padding: 20px 0;
        }

        a {
            text-decoration: none;
            color: #0084ff;
            margin-right: 10px;
        }

        table {
            border-collapse: collapse;
            width: 80%;
            margin: 20px auto;
            background-color: #fff;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
        }

        th, td {
            border: 1px solid #ddd;
            text-align: center;
            padding: 10px;
        }

        th {
            background-color: #0084ff;
            color: #fff;
        }

        tr:nth-child(even) {
            background-color: #f2f2f2;
        }

        .add-link {
            display: block;
            text-align: center;
            margin-top: 20px;
        }

        .add-button {
            display: inline-block;
            padding: 10px 20px;
            background-color: #0084ff;
            color: #fff;
            border: none;
            border-radius: 4px;
            cursor: pointer;
        }

        .add-button:hover {
            background-color: #0056b3;
        }
    </style>
</head>
<body>
    <h1>课程管理</h1>
    <a class="add-link" th:href="@{/manong/add}">
        <button class="add-button">添加课程</button>
    </a>

    <table>
        <tr>
            <th>课程号</th>
            <th>课程</th>
            <th>授课教师</th>
            <th>年级</th>
            <th>上课时间</th>
            <th>教室</th>
            <th>星期</th>
            <th>专业</th>
            <th>学分</th>
            <th>操作</th>
        </tr>
        <tr th:each="u:${list}">
            <td th:text="${u.cno}"></td>
            <td th:text="${u.course}"></td>
            <td th:text="${u.teacher}"></td>
            <td th:text="${u.year}"></td>
            <td th:text="${u.time}"></td>
            <td th:text="${u.classroom}"></td>
            <td th:text="${u.week}"></td>
            <td th:text="${u.speciality}"></td>
            <td th:text="${u.credit}"></td>
            <td>
                <a th:href="@{/manong/update(cno=${u.cno})}">修改</a>
                <a th:href="@{/manong/deleteLesson(cno=${u.cno})}" onclick="return confirm('确定要删除吗')">删除</a>
            </td>
        </tr>
    </table>
</body>
</html>
